<template>
	<div style="padding-top:50px;">
		<TopWithBack></TopWithBack>
    <div class="index_divide"></div>
    <div class="updatepassword_box">
        <input type="text" id="phone" placeholder=""  v-model="nickname" />
    </div>
    <div class="index_divide"></div>
  
    <div class="update_btn" @click="updateNickname"><input type="submit" value="修改"></div>
   
  </div>
</template>
<script>
import TopWithBack  from './../common/TopWithBack.vue'
import { getInfo } from '@/api/login'
import { updateInfo } from'@/api/allapis'
export default{
  name: 'UpNickName',
  data(){
    return{
        member_info:'',//个人信息
        nickname:''
    }
  },
  methods:{
      loadInfoMessage(){
          getInfo().then(response=>{
              this.member_info = response.data.member_info
              this.nickname = this.member_info.nickname
          })
      },//获取个人信息
      updateNickname(){
        updateInfo(this.nickname).then(response=>{
            this.$vux.toast.show({
              showPositionValue: false,
              text: text,
              type: type,
              width: width,
              position: 'middle'
            })
        })
      },
  },    
  components:{
  	TopWithBack,
  },
  created(){
    this.loadInfoMessage()
  }
}
</script>
<style>

</style>



